<template>
<div class="box">

  <ul
   class="post-box"
  > 
  
  <li 
  class="item cp"
    v-for="(v,index) in post" :key="index"
  >
   <router-link class="title cp"
          
       :to="{name:'post',params:{id: v._id}}">
        {{index+1}}. {{v.title}}
      </router-link>
     
  </li>
  </ul> 
  <div style="    text-align: right;
    height: 50px;
    padding-top: 12px;">
    <el-pagination
  background
  layout="prev, pager, next"
  :total="1000">
</el-pagination>
</div>
  </div>
</template>
<script>
import api from "@/api";
export default {
  name: "PostList",
  created() {
    api
      .queryPost({
        size: 10
      })
      .then(res => {
        // console.log(o);
        this.postLoading = false;

        this.post = res.data.data;
        //  loadinginstace.close()
      });
  },
  data() {
    return {
      postLoading: false,
      post: []
    };
  }
};
</script>
<style scoped>
a{
  text-decoration: pink;
  color: #000;
}
.box{
  background: white;
}
.post-box .item{
      height: 50px;
    line-height: 50px;
    padding-left: 12px;
    border-bottom: 1px dashed  #ccc;
}
</style>

